package com.hhh.springai_test.model.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 阅览室信息表
 * @TableName reading_room
 */
@TableName(value ="reading_room")
@Data
public class ReadingRoom {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 阅览室名称
     */
    private String roomname;

    /**
     * 阅览室图片地址
     */
    private String imageurl;

    /**
     * 阅览室介绍
     */
    private String description;

    /**
     * 开放时间
     */
    private String openinghours;

    /**
     * 当前人数
     */
    private Integer currentcount;

    /**
     * 总座位数
     */
    private Integer totalseats;

    /**
     * 座位占用情况(JSON字符串)
     */
    private String seatstatus;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createtime;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updatetime;

    /**
     * 是否删除
     */
    @TableLogic
    private Integer isdelete;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ReadingRoom other = (ReadingRoom) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getRoomname() == null ? other.getRoomname() == null : this.getRoomname().equals(other.getRoomname()))
            && (this.getImageurl() == null ? other.getImageurl() == null : this.getImageurl().equals(other.getImageurl()))
            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
            && (this.getOpeninghours() == null ? other.getOpeninghours() == null : this.getOpeninghours().equals(other.getOpeninghours()))
            && (this.getCurrentcount() == null ? other.getCurrentcount() == null : this.getCurrentcount().equals(other.getCurrentcount()))
            && (this.getTotalseats() == null ? other.getTotalseats() == null : this.getTotalseats().equals(other.getTotalseats()))
            && (this.getSeatstatus() == null ? other.getSeatstatus() == null : this.getSeatstatus().equals(other.getSeatstatus()))
            && (this.getCreatetime() == null ? other.getCreatetime() == null : this.getCreatetime().equals(other.getCreatetime()))
            && (this.getUpdatetime() == null ? other.getUpdatetime() == null : this.getUpdatetime().equals(other.getUpdatetime()))
            && (this.getIsdelete() == null ? other.getIsdelete() == null : this.getIsdelete().equals(other.getIsdelete()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getRoomname() == null) ? 0 : getRoomname().hashCode());
        result = prime * result + ((getImageurl() == null) ? 0 : getImageurl().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        result = prime * result + ((getOpeninghours() == null) ? 0 : getOpeninghours().hashCode());
        result = prime * result + ((getCurrentcount() == null) ? 0 : getCurrentcount().hashCode());
        result = prime * result + ((getTotalseats() == null) ? 0 : getTotalseats().hashCode());
        result = prime * result + ((getSeatstatus() == null) ? 0 : getSeatstatus().hashCode());
        result = prime * result + ((getCreatetime() == null) ? 0 : getCreatetime().hashCode());
        result = prime * result + ((getUpdatetime() == null) ? 0 : getUpdatetime().hashCode());
        result = prime * result + ((getIsdelete() == null) ? 0 : getIsdelete().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", roomname=").append(roomname);
        sb.append(", imageurl=").append(imageurl);
        sb.append(", description=").append(description);
        sb.append(", openinghours=").append(openinghours);
        sb.append(", currentcount=").append(currentcount);
        sb.append(", totalseats=").append(totalseats);
        sb.append(", seatstatus=").append(seatstatus);
        sb.append(", createtime=").append(createtime);
        sb.append(", updatetime=").append(updatetime);
        sb.append(", isdelete=").append(isdelete);
        sb.append("]");
        return sb.toString();
    }
}